﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Specail.aspx.cs" Inherits="Web.Specail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <base target="_self" />
    <link href="Styles/Style01.css" rel="stylesheet" type="text/css" />
    <script src="Content/scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.7.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <fieldset>
                <legend>添加</legend>
                <table><tr>
                    <td><label for="speDate">日期</label></td>
                    <td><input id="speDate" runat="server" class="Wdate" onclick="WdatePicker();" /></td>
                    <td><label for="chkIsWork">是/否上班</label></td>
                    <td><input type="checkbox" id="chkIsWork" runat="server" /></td>
                    <td><input type="submit" id="btnSub" runat="server" value="添加日期" onclick="return checkValidation();"  onserverclick="btnSub_Click"/><label id="lblmsg" style="color:#ff0000" ></label></td>
                </tr></table>
        </fieldset>
        <div style="margin:0px auto;">
            <asp:GridView ID="gv" runat="server" AllowPaging="True" PageSize="25"
                    onpageindexchanging="gv_PageIndexChanging" 
                AutoGenerateColumns="False"  Width="684px" >
                <Columns>
                    <asp:TempLateField HeaderText="日期" >
                        <ItemTemplate>
                            <asp:Label ID="lblDate" runat="server" Text='<%#Eval("SpecialDate","{0:yyyy-MM-dd}") %>' ></asp:Label>
                        </ItemTemplate>
                    </asp:TempLateField>
                    <asp:TemplateField HeaderText="是否上班">
                        <ItemTemplate>
                            <asp:Label ID="lblIsWork" runat="server" Text='<%#Eval("iswork").ToString()=="1"?"是":"否" %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtnDel" runat="server" Text="删除" CommandArgument='<%#Bind("id") %>'  OnCommand="lbtnDel_Click" ></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
    </form>
    <script type="text/javascript">

        function checkValidation() {
            if ($("#speDate").val() == "") {
                $("#lblmsg").text("选择日期");
                return false;
            }
            else
                return true;
        }
    </script>
</body>
</html>